package com.lxw.filesystem.config;


import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FileConfig {

    @Value("${ysp.oss.Endpoint}")
    public String endpoint;
    @Value("${ysp.oss.AccessKeyID}")
    public String AccessKeyID;
    @Value("${ysp.oss.AccessKeySecret}")
    public String AccessKeySecret;


    @Bean
    public OSS oss(){
        // 创建OSSClient实例。
        OSS ossClient = new OSSClientBuilder().build(endpoint, AccessKeyID, AccessKeySecret);
        return ossClient;
    }
}
